e
#Title[ʏ4]
#Text[xmoRcA[ւ悤
ʏ5]
#BackGround[User]
#BGM[.\..\bgm\bgm.wav]
#Player[FREE]
#ScriptVersion[2]

script_enemy_main {
	
	////////////////////////////////////////////////////////////////////////
	//                                                          //
	//   e摜̕ύX                                                     //
	//   x߂                                                 //
	////////////////////////////////////////////////////////////////////////
	
	@Initialize{
		InitializeData();
		
		LoadUserShotData(shot_ryoyan);
		
		SetLife(4000);
		SetDamageRate(150,100);
		SetMovePosition03(GetCenterX(),150,10,8);
		SetInvincibility(120);
		SetCollisionEx(32,16);
		SetEnemyMarker(true);
		
		TMain();
	}
	
	@MainLoop{
		yield;
	}
	
	@DrawLoop{
		DrawBoss(imgBoss);
	}
	
	@Finalize{
		FinalizeData();
	}
	
	task TMain(){
		wait(120);
		
		SetTimer(60);
		
		Atack();
		Move();
	}
	
	task Atack(){
		let count=0;
		loop{
			let nam = 18;
			let spd = 2.6;
			let ang = 90 * p1m0(count);
			
			ascent(cnt2 in 0..3) {
				ascent(cnt in 0..nam) {
					let x1=cos(ang+cnt2*120);
					let x2=cos(120+ang+cnt2*120);
					let x=x1+(x2-x1)*cnt/nam;
					let y1=sin(ang+cnt2*120);
					let y2=sin(120+ang+cnt2*120);
					let y=y1+(y2-y1)*cnt/nam;
					let ang2=atan2(y,x);
					let spd2=spd*((y)^2+(x)^2)^0.5;
					let id=CreateShotObj(GetX(),GetY(),spd2,ang2,_RED01L(),0);
					AA_Reflect(id,1,true,true,false,true);
				}
			}
			count++;
			
			wait(120);
		}
	}
	
	task Move(){
		let tm=0;
		
		loop{
			wait(150);
			tm = ( ( GetPlayerX() > GetX() ) - ( GetPlayerX() < GetX() ) ) * 30;
			SetMovePosition03(GetX() + tm,rand(160,200),10,5);
			wait(60);
		}
	}
	
	#include_function ".\..\functions\initialize.txt"
	#include_function ".\..\functions\color_set.txt"
	#include_function ".\..\functions\function.txt"
}
